package com.huadao.cart_ccs.modle;

import android.content.Context;

import com.huadao.cart_ccs.base.BaseHttpModel;
import com.huadao.cart_ccs.data.bo.OperationLogBO;
import com.huadao.cart_ccs.data.source.http.Api;
import com.huadao.cart_ccs.data.source.http.HttpFunction;
import com.huadao.cart_ccs.data.source.http.RetrofitHelper;
import com.huadao.cart_ccs.main.CartApplication;

import io.reactivex.Observable;

public class OperationLogModel extends BaseHttpModel {
    private Api api;

    public OperationLogModel(Context context) {
        api=RetrofitHelper.getInstance(context).create(Api.class);
    }

    public Observable<OperationLogBO> createOperation(String behavior,String remark){
        OperationLogBO operationLogBO=new OperationLogBO();
        operationLogBO.setProjectId(CartApplication.getInstance().getSystemProjectId());
        operationLogBO.setIdentifier(CartApplication.getInstance().getSystemProjectIdentifier());
        operationLogBO.setBehavior(behavior);
        operationLogBO.setRemark(remark);
        return api.createOperationLog(operationLogBO).map(new HttpFunction());
    }
}